
export const request = (params) => {
	const baseUrl = "https://dysx-api.ksbmtb.com:8889"
	// const baseUrl = "https://proxy1.ksbmtb.com"
	// const baseUrl = "http://192.168.1.51:8081"
	// 请求变成大写的
	params.method = params.method && params.method.toUpperCase();
	return new Promise((resolve, reject) => {
		uni.request({
			...params,
			header: {
				'content-type': 'application/x-www-form-urlencoded'
			},
			url: baseUrl + params.url,
			success: (result) => {
				resolve(result.data)
			},
			fail: (err) => {
				reject(err)
			},
			complete: () => {
				
			}
		});
	})
}
// 私信客服的接口
export const callService = (params) => {
	const baseUrl = "https://gaode-api.ksbmtb.com:8999"
	params.method = params.method && params.method.toUpperCase();
	return new Promise((resolve, reject) => {
		uni.request({
			...params,
			header: {
				'content-type': 'application/x-www-form-urlencoded'
			},
			url: baseUrl + params.url,
			success: (result) => {
				resolve(result.data)
			},
			fail: (err) => {
				reject(err)
			},
			complete: () => {

			}
		});
	})
}
